﻿package java_45;

import java.util.ArrayList;
import java.util.List;

import entity.NewTitle;

public class NewTitleDemo {

    public static void main(String[] args) {
      
        NewTitle car = new NewTitle(1, "汽车", "管理员");
        NewTitle test = new NewTitle(2, "高考", "管理员");
       
        List newsTitleList = new ArrayList();
        
        newsTitleList.add(car);
        newsTitleList.add(test);
      
        System.out.println("新闻标题数目为：" + newsTitleList.size() + "条");
        
        for (int i = 0; i < newsTitleList.size(); i++) {
            NewTitle title = (NewTitle) newsTitleList.get(i);
            System.out.println(i + 1 + ":" + title.getTitleName());
        }

    }

}